UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xZ/N53xJtm0/Nno7f/2USj6/FqoXkBWhRJBS6FpaNKA=' 
WHERE 
  key_id = '009a392233755ce61f14b0022823e8edf30f802322f047c92736430391a7c261' 
  AND (
    token = 'xZ/N53xJtm0/Nno7f/2USj6/FqoXkBWhRJBS6FpaNKA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040