UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tM+sHrsJx3hwpuWn/Ess+WTUzv5mPuiKEyHLjYXMa7k=' 
WHERE 
  key_id = '469190ba2bea3ed937ae0c35b26ce6b88ef7ded2f60aadd7570b162a1441f0ea' 
  AND (
    token = 'tM+sHrsJx3hwpuWn/Ess+WTUzv5mPuiKEyHLjYXMa7k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031