UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DTpN4+U8ppCgbYLVBPL/Jgq3x4OXN+ZhhVb75kQqfeI=' 
WHERE 
  key_id = '06f91953fc67e58f496651cf7261b66cba92ab540d2fdcba2a59dcf970bb354c' 
  AND (
    token = 'DTpN4+U8ppCgbYLVBPL/Jgq3x4OXN+ZhhVb75kQqfeI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024