UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cE52mDU/q049BI4rwaqhK8vYKt0yPCdVI9mPYNUqxeQ=' 
WHERE 
  key_id = '2f21c3e3d9cadc743e45204a49c77d2706231cad4db46dc9e857a3e855424598' 
  AND (
    token = 'cE52mDU/q049BI4rwaqhK8vYKt0yPCdVI9mPYNUqxeQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055