UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'i0qMGtE6UbKUxOvFc4N5OzvfjU7SF3vxNoq3ls/Keqg=' 
WHERE 
  key_id = '24f3fe9484ba812e14d840773817960918a5a872190b2b2465bb802a99bf0ecd' 
  AND (
    token = 'i0qMGtE6UbKUxOvFc4N5OzvfjU7SF3vxNoq3ls/Keqg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029