UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'a+k/lyl+MdqhaeUHBHijQs1sT+h/8JeWXjakS8g4rMo=' 
WHERE 
  key_id = '5119dd478aa76370cd2003a4a9c30f9817408e345bb6cdc9c8895dc010bd32a8' 
  AND (
    token = 'a+k/lyl+MdqhaeUHBHijQs1sT+h/8JeWXjakS8g4rMo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031