UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '44y3X+fNphp2k+8uNt2zyX0/AKiYQvYocJpRcpOFu8I=' 
WHERE 
  key_id = '827b9084e36ceacca0c7e360f761bb9c9547fc6acb400c4dfa7ca46d1963108d' 
  AND (
    token = '44y3X+fNphp2k+8uNt2zyX0/AKiYQvYocJpRcpOFu8I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024