UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9zRx0HmVyx37yAkL8Qqe1aJU53x3KDhwYlLRgvgaHFU=' 
WHERE 
  key_id = '8a4416f35944e0a9052d9c34b9e87ade4023217a355528a514866b78437cd741' 
  AND (
    token = '9zRx0HmVyx37yAkL8Qqe1aJU53x3KDhwYlLRgvgaHFU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028