UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jUZSufZ3oRDkoOqsQ5ryBUq9XUlmhpF4ZPoldX5uFkA=' 
WHERE 
  key_id = 'e14111fca3514e0571c9f186cce7b81b4082ac95b98542d68f4c1c535e3aaf3f' 
  AND (
    token = 'jUZSufZ3oRDkoOqsQ5ryBUq9XUlmhpF4ZPoldX5uFkA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050