UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0eTuYuUfr6JETuO6slvvdBBHRjRXdFwTqX4g32fkcIU=' 
WHERE 
  key_id = 'dac2cc91e6efe64799517f7da2f70a2fbd6f74bba9fa127719735c46ac71ef68' 
  AND (
    token = '0eTuYuUfr6JETuO6slvvdBBHRjRXdFwTqX4g32fkcIU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052