UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hrRxjEFY/DarurBz2EiJdQFHPpqi5hgHNCZ9u7eYa7E=' 
WHERE 
  key_id = 'abe9fd278e4fc68c121af21f41edd88840e0815d00ef33d1c821cf9944312f3e' 
  AND (
    token = 'hrRxjEFY/DarurBz2EiJdQFHPpqi5hgHNCZ9u7eYa7E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057