UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'y7mrx3SlWqYM8xb1i7I7raUlv4Dsb++cvhEjESOJjFk=' 
WHERE 
  key_id = 'b75f356c0a7e61de61894ca04906b6fcabea68fa2c5b405d88b69f65fa9ad19c' 
  AND (
    token = 'y7mrx3SlWqYM8xb1i7I7raUlv4Dsb++cvhEjESOJjFk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036