UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vMnxdkuE3ldLfxnoz6cEti1/XT2i/gEhulhZfFcH0jc=' 
WHERE 
  key_id = 'fed1da0df1f3ce96eb03302e29d1adfbc31d5a28369a3ad1c466aa7e4594ae31' 
  AND (
    token = 'vMnxdkuE3ldLfxnoz6cEti1/XT2i/gEhulhZfFcH0jc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020