UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vbBij2uc+QEDEYAYjqmB7kGFFWwCNTmoK2MfWnc3pYY=' 
WHERE 
  key_id = '4dfb4fc93bd97ffb77c7336233eb6bec6c5b3de9116bff5b6180f26e7683c68b' 
  AND (
    token = 'vbBij2uc+QEDEYAYjqmB7kGFFWwCNTmoK2MfWnc3pYY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021