UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HZHsuQaO8ZD4jSpSfQR1DvpcbyMxL3TRbmdezLzo2Pg=' 
WHERE 
  key_id = '0b7393b6ce79ad0dbf86ee246bbe3544ea7936811f132660b408bf478b942c89' 
  AND (
    token = 'HZHsuQaO8ZD4jSpSfQR1DvpcbyMxL3TRbmdezLzo2Pg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048