UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'adwMaZAtNgIJJvHsQSrp+iRMjzqV4LJrsVztTZymDiw=' 
WHERE 
  key_id = '23f0ed9de0fecda1ce6517ebb1582c12561daef45660a2fdffa6cb92b58e26cd' 
  AND (
    token = 'adwMaZAtNgIJJvHsQSrp+iRMjzqV4LJrsVztTZymDiw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029