UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0iRpm+0xnoL/3m50QyeI8IprNWVkd9+bOqOFWxP0X5A=' 
WHERE 
  key_id = '093df46057802f5f1fcc1188f6b0bf283c97256a439ec3eeb53ac02db8e3fcb9' 
  AND (
    token = '0iRpm+0xnoL/3m50QyeI8IprNWVkd9+bOqOFWxP0X5A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022