UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JZ56lPn5KruhQA1+sTcOl2ryMa2wlHAqLrq0p3jAegY=' 
WHERE 
  key_id = '04591fb7dcb8ebd4522144fe0451aaa86a8d69174b83d53feb9a7b6cdb80b5bd' 
  AND (
    token = 'JZ56lPn5KruhQA1+sTcOl2ryMa2wlHAqLrq0p3jAegY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034