UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dPtz0IBOFlsv+il6N+b5RMbzcjQyFbICHMrUz4ZOq0E=' 
WHERE 
  key_id = 'eca8f8eccf0c244dc350f096ed109278c42bdfd9326bc97343c276303810c8f5' 
  AND (
    token = 'dPtz0IBOFlsv+il6N+b5RMbzcjQyFbICHMrUz4ZOq0E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027