UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oUB4H2S/ywVU8vsr1BPPUQyMi3m94i6VtvmlW8zSDZg=' 
WHERE 
  key_id = '5debe64a6ebde957647c8481fdec9a2356bc6c513f595651de47da8b6d9f01ae' 
  AND (
    token = 'oUB4H2S/ywVU8vsr1BPPUQyMi3m94i6VtvmlW8zSDZg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028