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