UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lrm9p09m/YnkpDdGNxDBnehem0UHlA8IF0tmZcwxZwc=' 
WHERE 
  key_id = '5dcce3771bd258db1b32566a57be071da43271e126387be3c5731e40c7c843b2' 
  AND (
    token = 'lrm9p09m/YnkpDdGNxDBnehem0UHlA8IF0tmZcwxZwc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030