UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'H3xbPXeZl0TKoC426Z/inSbdcl34wpvb5xGuLvmq2eE=' 
WHERE 
  key_id = '9ef45d5347daf5c0c4057da96cd4b823fd52edc8606143a0d9215516b8f7602e' 
  AND (
    token = 'H3xbPXeZl0TKoC426Z/inSbdcl34wpvb5xGuLvmq2eE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025