UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fuBUkIT4uliDvsOtbadm/eOXilhsjUCtS1Y8ecnW2wg=' 
WHERE 
  key_id = 'a707d5b8210ecd5823ddfc276d614f2488b221cc8c16be5e8484b5f0031b1bcc' 
  AND (
    token = 'fuBUkIT4uliDvsOtbadm/eOXilhsjUCtS1Y8ecnW2wg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048