UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tiNH26ETuW9nz8Zj1E0vAN2pEs6vQCuV6fNIp6pgD4s=' 
WHERE 
  key_id = '2c4af30c4e2ff8673f33d34a39c8c240b27e453a9801d725e4de8cd3c052ddaa' 
  AND (
    token = 'tiNH26ETuW9nz8Zj1E0vAN2pEs6vQCuV6fNIp6pgD4s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053