UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hUX0lILrOnvPoknMGlQeLFd5c470vnhtu9GZZ5ouNwg='
WHERE
key_id = '6ec559edd754e75de91496d3db7f50159370aa8cd7dfbf2014cf7ad6f70fe08a'
AND (
token = 'hUX0lILrOnvPoknMGlQeLFd5c470vnhtu9GZZ5ouNwg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)