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

Query time 0.00030