UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JfQQRRIc861s/zR0FuzVS1TQjsrhh4UFDnK4mSh8mwg=' 
WHERE 
  key_id = '797d2155a28e81e6c8586816a647d927bbff3fdb3dd672c2a1b11165b1106a44' 
  AND (
    token = 'JfQQRRIc861s/zR0FuzVS1TQjsrhh4UFDnK4mSh8mwg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050