UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kPUDmV4fyy2K/ETFqdckbsR6Fh0QyPbDT74weG57jV0=' 
WHERE 
  key_id = '4cc603333c9214a7fc7cb2da685f066e61fea19e742347f0f3e43f016a5afde5' 
  AND (
    token = 'kPUDmV4fyy2K/ETFqdckbsR6Fh0QyPbDT74weG57jV0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043