UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nw/yrKC2+31fsSm0UTXIDnkB0pHkA301lk0jZ9nCr3I=' 
WHERE 
  key_id = '285793fade8f3156363bf1c303d15e9e0fe7c63dca313054a653b8f2928f65fe' 
  AND (
    token = 'nw/yrKC2+31fsSm0UTXIDnkB0pHkA301lk0jZ9nCr3I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042