UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Gkhpvdf+oby40ZNISr8p8Lhaz1D+MKc6RMnTaRA5Po4='
WHERE
key_id = 'aec4a093252ca9743052f422d2d08ff4c7d872acde4639b50aa5700599b26a7a'
AND (
token = 'Gkhpvdf+oby40ZNISr8p8Lhaz1D+MKc6RMnTaRA5Po4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)