UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OFnFFE1kdUqBEgH1mIFTr0j7YhP3d6PN/1gAA5c2bgQ=' 
WHERE 
  key_id = 'cb0f336b85afd1424fb783856742cb9743eabd67ab9388b81f41f81cb6a377a3' 
  AND (
    token = 'OFnFFE1kdUqBEgH1mIFTr0j7YhP3d6PN/1gAA5c2bgQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057