UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/rLUYxFl+KuCwATWltta2gBIVYxotMSotmLfd2KFI4w=' 
WHERE 
  key_id = 'cba3d1c9664bec3e343fedc39a85ebd8bf7ef0d96a0eb81e2fc2ecdf1463edbf' 
  AND (
    token = '/rLUYxFl+KuCwATWltta2gBIVYxotMSotmLfd2KFI4w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031