UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '48JLzD+LVSayBAz+yrjr0UUqBtqlkkHWul/jLIx2P1Q=' 
WHERE 
  key_id = '2137f584691439d3477f76960837f9bd10e716c6fc060aeef7baa18b7239cced' 
  AND (
    token = '48JLzD+LVSayBAz+yrjr0UUqBtqlkkHWul/jLIx2P1Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00174