UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'myq9aHgLVKEdiV6gsJF805WXwTQ9G4rH62oKcq/Ex3Q=' 
WHERE 
  key_id = '7bf26df7783c43002677a746fd6df28054f515a9304f02dc67b55058f6984e02' 
  AND (
    token = 'myq9aHgLVKEdiV6gsJF805WXwTQ9G4rH62oKcq/Ex3Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039