UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 's+gQtDM2sCKGrWKXMelds5kH5AZyzXkv0jAlQUnggZo=' 
WHERE 
  key_id = 'a1863f48d308bac223f7ee981a9dcca939e450f61d54e7a8708492b543696fe1' 
  AND (
    token = 's+gQtDM2sCKGrWKXMelds5kH5AZyzXkv0jAlQUnggZo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033