UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hFuzoaSQ94UNGb79UKiDeem+GE6FSC+Ifl88nM9XONw=' 
WHERE 
  key_id = 'cfc61de623f956afa3452b60db1c6707d3f676e1b0bc9d5404b3219f18d88acc' 
  AND (
    token = 'hFuzoaSQ94UNGb79UKiDeem+GE6FSC+Ifl88nM9XONw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032