UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZCTh/OrPC3KZpx6bpx6wyRnnRlU1SbqRiS05IHg5sY8=' 
WHERE 
  key_id = '6a00ddc15c311b1c75358ce9d05a1d9b8343c6dbbed24c8111e537daa7362129' 
  AND (
    token = 'ZCTh/OrPC3KZpx6bpx6wyRnnRlU1SbqRiS05IHg5sY8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027