UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'B50RMD7/WFoe8AaKXPo/Qo07C4nx+0ITyWaC7iIau5c=' 
WHERE 
  key_id = '72f65c61f616d46ee5fd9085edcac687286498c71b737fe0c965a059ca3237e1' 
  AND (
    token = 'B50RMD7/WFoe8AaKXPo/Qo07C4nx+0ITyWaC7iIau5c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025