UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SEodoR9qA8CONeo6TXS36VFF7iPOokxesmEY2i6Jj2A='
WHERE
key_id = 'cf9feaa811d9a5997960d3c089470a2966f0cc3156f684b8fa15f471df7fd453'
AND (
token = 'SEodoR9qA8CONeo6TXS36VFF7iPOokxesmEY2i6Jj2A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)